const routes = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/loginView/index.vue')
  },
  {
    path: '/dashboard',
    component: () => import('@/components/Layout.vue'),
    // meta: {
    //   requiresAuth: true
    // },
    children: [
      {
        path: '',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/index.vue')
      },
      {
        path: 'users',
        name: 'UserManage',
        component: () => import('@/views/userManage/index.vue'),
        meta: {
          permissions: ['user:read']
        }
      },
      {
        path: 'roles',
        name: 'RoleManage',
        component: () => import('@/views/roleManage/index.vue'),
        meta: {
          permissions: ['role:read']
        }
      },
      {
        path: 'spider/tasks',
        name: 'SpiderTasks',
        component: () => import('@/views/spider/tasks/index.vue')
      },
      {
        path: 'spider/data',
        name: 'SpiderData',
        component: () => import('@/views/spider/data/index.vue')
      },
      {
        path: 'server-monitor',
        name: 'ServerMonitor',
        component: () => import('@/views/serverMonitor/index.vue'),
        meta: {
          permissions: ['system:monitor']
        }
      }
    ]
  }
]

export default routes